﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ZFMaster.Master" AutoEventWireup="true"
    CodeBehind="ydjp.aspx.cs" Inherits="ZF.WS.service.ydjp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="/css/validator.css" rel="stylesheet" type="text/css" />

    <script src="/js/formValidator.js" type="text/javascript" language="javascript"></script>

    <script src="/js/formValidatorRegex.js" type="text/javascript" language="javascript"></script>

    <script src="/js/jqPlugins/onlypressnum.js" type="text/javascript" language="javascript"></script>
 
    <script language='javascript' type="text/javascript">
        function refreshValidateCodeImage(ValidateCodeImageControl) {

            var url = ValidateCodeImageControl.src;
            if (url.indexOf("?code=") > -1) {
                url = url.split("?")[0];
            }
            ValidateCodeImageControl.src = url + '?code=' + randomNum(10);
        }
        function randomNum(n) {
            var rnd = '';
            for (var i = 0; i < n; i++)
                rnd += Math.floor(Math.random() * 10);
            return rnd;

        }
        $(function() {
            $(".vcodeimg")[0].click();

        });
    </script>

    <script>

        $(function() {

            $.formValidator.initConfig({ formid: document.forms[0].id, onerror: function(msg) { alert(msg) } });

            $(".tbCompanyName").formValidator({ tipid: "tbCompanyNameTip", onshow: " ", onfocus: " ", oncorrect: " ", onempty: " " })
    .inputValidator({ min: 1, onerror: "企业名称不能为空" });



            $(".tbContact").formValidator({ tipid: "tbContactTip", onshow: "( 如王先生)", onfocus: "( 如王先生)", oncorrect: " ", onempty: "( 如王先生)" })
    .inputValidator({ min: 1, onerror: "输入错误：必须输入联系人" });

            $(".tbTel").formValidator({ tipid: "tbTelTip", onshow: "( 固话号码或手机号码，如果有多个用“，”分隔)", onfocus: "( 固话号码或手机号码，如果有多个用“，”分隔)", oncorrect: " ", onempty: "(  固话号码或手机号码，如果有多个用“，”分隔)" })
    .inputValidator({ min: 1, onerror: "输入错误：请至少输入一个联系电话" });


            //            $(".tbPrice").formValidator({ tipid: "tbPriceTip", onshow: "(人民币：万元)", onfocus: "(人民币：万元)", oncorrect: " ", onempty: "(人民币：万元)" })
            //    .regexValidator({ regexp: "num", datatype: "enum", onerror: "交易价格错误" });
            //    
            $(".tbCredit").formValidator({ tipid: "tbCreditTip", onshow: "(人民币：万元)", onfocus: "(人民币：万元)", oncorrect: " ", onempty: "(人民币：万元)" })
    .regexValidator({ regexp: "num", datatype: "enum", onerror: "交易价格错误" });
            $(".tbEmail").formValidator({ tipid: "tbEmailTip", onshow: "为了便于我们联系您，请输入您的邮箱地址.如:abc@163.com", onfocus: "为了便于我们联系您，请输入您的邮箱地址.如:abc@163.com", oncorrect: "", onempty: "为了便于我们联系您，请输入您的邮箱地址.如:abc@163.com" })

            .functionValidator({ fun: function(value) {
                var reg = new RegExp("^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$");

                if (value != "" && !reg.test(value))
                    return "输入格式错误";
                else
                    return true;
            }
            });

            $(".tbDeparture").formValidator({ tipid: "tbDepartureTip", onshow: "（出发地）", onfocus: "（出发地）", oncorrect: "（出发地）", onempty: "（出发地）" })
    .inputValidator({ min: 1, onerror: "请输入出发地" });
            $(".tbPurpose").formValidator({ tipid: "tbPurposeTip", onshow: "（目的地）", onfocus: "（目的地）", oncorrect: "（目的地）", onempty: "（目的地）" })
    .inputValidator({ min: 1, onerror: "请输入目的地" });


            $(".tbBegDate").formValidator({ tipid: "tbBegDateTip", onshow: "(出发日期)", onfocus: "(出发日期)", oncorrect: " ", onempty: "(出发日期)" })
    .inputValidator({ min: 1, onerror: "请选择出发日期" });
            $(".tbEndDate").formValidator({ tipid: "tbEndDateTip", onshow: "(返回日期)", onfocus: "(返回日期)", oncorrect: " ", onempty: "(返回日期)" })
    .functionValidator({ fun: function(value) {
        if ($(".divTravel input[@value='双程']")[0].checked) {
            return value != "";
        }
        else
            return true;
    }
    });

        });
    
    
    </script>

    <div class="location mb10_">
        您现在的位置：<a href="/"><%=SiteInfo.Instance.SystemConfig.SiteName %></a> >> <a href="<%=this.Request.Url %>">
            预订特价国际机票、国内机票</a>
    </div>
    <div>
        <table class="service" cellpadding="1" cellspacing="1">
            <tr>
                <th colspan="2">
                   

 
                     <span class="fl_"> 预订特价国际机票、国内机票</span> 
                         <a href="/service/cservice.aspx?type=<%=HttpUtility.UrlDecode("预订机票") %>" target="_blank">
                     
                      <img src="/image/zxzx.gif" class="vam_  mt8_  fr_  mr10_ cp_"     /> </a>
          
                </th>
            </tr>
 
             <tr>
              <td class="l">
                    <span class=" xh_"></span>联系方式：
                </td>
                 <td class="r" >
                     <%--<div class="f14_">广州泰基商旅中心 &nbsp;&nbsp; 电话：020-86347150 &nbsp;&nbsp; 电子邮箱：1382622287@163.com &nbsp;&nbsp; 
                       </div>--%>
                       <div class="f14_">泰基商旅 &nbsp;&nbsp; 电话：020-86347150 0766-8217659 13417997721 &nbsp;&nbsp; 电子邮箱：806152634@qq.com    &nbsp;&nbsp; 
                       </div>
                  
                 </td>
            </tr>
            
         
            <tr>
                <td class="l">
                    <span class=" xh_">*</span>企业名称/联系人名称：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbCompanyName" class="txt"></zf:TextBox>
                        <span class="zx_" id="tbCompanyNameTip"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="l">
                    <span class=" xh_"></span>联系地址：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbAddress" class="ltxt"></zf:TextBox>
                        <span class="zx_" id="tbAddressTip"></span>
                    </div>
                </td>
            </tr>
             <tr class="dn_">
                <td class="l">
                    <span class=" xh_">*</span>乘机人数：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbCount" class="sstxt" Text="0"></zf:TextBox>(人)
                        <span class="zx_" id="tbCountTip"></span>
                    </div>
                </td>
            </tr>
            
            <tr>
                <td class="l">
                    <span class=" xh_">*</span>乘机人资料：<br />
                </td>
                <td class="r">
                    <div class="c people">
                        <ul>
                            <li>乘机人姓名:<input type="text" class="sstxt name"   />&nbsp;&nbsp; 
                                证件号码:<input type="text" class="ltxt id" /><span class="zx_"><select class="ddl">
                                <option value="身份证">身份证</option>
                                <option value="护照">护照</option>
                                </select>
                                </li></span>
                                &nbsp;&nbsp;<input type="button" class="remove vam_" value="删除" />
                                </li>
                                
                        </ul>
                    </div>
                    <div class="peopleTemplate dn_">
                        <ul>
                          <li>乘机人姓名:<input type="text" class="sstxt name" />&nbsp;&nbsp; 
                                证件号码:<input type="text" class="ltxt id" /><span class="zx_"><select class="ddl">
                                <option value="身份证">身份证</option>
                                <option value="护照">护照</option>
                                </select>
                                </li></span>
                                &nbsp;&nbsp;<input type="button" class="remove vam_" value="删除" />
                                
                                
                        </ul>
                    </div>
                    <zf:TextBox runat="server" ID="tbPeopleList" class="dn_"></zf:TextBox>
                    
                    <div class="zx_ mt5_">乘机人姓名必须与证件号码上的姓名完全相同</div>
                    <input type="button" class="addPeople mt5_" value="增加乘机人" />
                </td>

                <script>

                    $(function() {
                        $(document.forms[0]).submit(function() {
                            var success = true;
                            var json = [];
                            $(".people li").each(function() {

                                var li = $(this);

                                if ($.trim(li.find(".name").val()) == "") {
                                    alert("请输入乘机人姓名");
                                    success = false;
                                    return false;
                                } else if ($.trim(li.find(".id").val()) == "") {
                                    alert("请输入乘机人证件号码");
                                    success = false;
                                    return false;
                                } else {
                                    json.push({ Name: $.trim(li.find(".name").val()), Id: $.trim(li.find(".id").val()),Type:li.find("select")[0].value });
                                }
                            });
                            if (success) {
                                $(".tbCount").val($(".people li").length);
                                $(".tbPeopleList").val($.toJSON(json));
                            }
                            return success;

                        });
                        $(".addPeople").click(function() {
                            $(".people").append($(".peopleTemplate").html());
                            $(".people").find(".remove").click(function() {
                                $(this.parentNode.parentNode).remove();
                            });
                        });

                    });
                    
                    
                </script>

            </tr>
            
 
            <tr>
                <td class="l">
                    <span class=" xh_">*</span>出发地/目的地：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbDeparture" class="sstxt"></zf:TextBox><span class="zx_"
                            id="tbDepartureTip">(出发地)</span>&nbsp;&nbsp;
                        <zf:TextBox runat="server" ID="tbPurpose" class="sstxt"></zf:TextBox><span class="zx_"
                            id="tbPurposeTip">(目的地)</span>
                    </div>
                </td>
            </tr>
             <tr>
                <td class="l">
                    <span class=" xh_">*</span>单程/双程：
                </td>
                <td class="r">
                    <div class="c divTravel">
                        <zf:RadioButtonList runat="server" ID="rblTravel" RepeatDirection="Horizontal">
                            <asp:ListItem Text="单程" Value="单程" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="双程" Value="双程"></asp:ListItem>
                        </zf:RadioButtonList>
                        <span class="zx_" id="Span3"></span>
                    </div>
                </td>
                <script>
                    $(function() {
                        $(".divTravel input").click(function() {
                            if ($(".divTravel input[@value='双程']")[0].checked) {
                                $(".spanEndDate").show();
                            } else {
                                $(".spanEndDate").hide();
                            }
                        });
                        if ($(".divTravel input[@value='双程']")[0].checked) {
                            $(".spanEndDate").show();
                        } else {
                            $(".spanEndDate").hide();
                        }
                    });
                    
                </script>
            </tr>
             
             <tr>
                <td class="l">
                    <span class=" xh_">*</span>往/返日期：
                </td>
                <td class="r">
                    <div class="c">
                        
                        <zf:TextBox runat="server" ID="tbBegDate" class="dttxt"   ></zf:TextBox>
                        <img  src="/images/calendar.gif" onclick="calendar($('.tbBegDate')[0]);" class="cp_" />
                        <span class="zx_" id="tbBegDateTip">(出发日期)</span>&nbsp;&nbsp;
                        
                        <span class="spanEndDate dn_">
                        <zf:TextBox runat="server" ID="tbEndDate" class="dttxt" ></zf:TextBox>
                         <img  src="/images/calendar.gif" onclick="calendar($('.tbEndDate')[0]);" class="cp_" />
                        <span class="zx_" id="tbEndDateTip">(返回日期)</span>&nbsp;&nbsp;
                       </span>
                    </div>
                </td>
            </tr>
              <tr>
                <td class="l">
                    <span class=" xh_"></span>航空公司：
                </td>
                  <td class="r">
                      <div class="c">
                      <zf:TextBox runat="server" ID="tbAviationCompany" class="dttxt" ></zf:TextBox>
                       
                      </div>
                  </td>
            </tr>
             
             
            <tr>
                <td class="l">
                    <span class=" xh_">*</span>联系人：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbContact" class="stxt"></zf:TextBox><span class="zx_"
                            id="tbContactTip"></span>
                    </div>
                </td>
            </tr>
            
            <tr>
                <td class="l">
                    <span class=" xh_">*</span>联系电话：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbTel" class="txt"></zf:TextBox>
                        <span class="zx_" id="tbTelTip"></span>
                    </div>
                </td>
            </tr>
            
            <tr>
                <td class="l">
                    电子邮箱：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbEmail" class="txt"></zf:TextBox>
                        <span class="zx_" id="tbEmailTip"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="l">
                    其他说明：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbRemark"  TextMode="MultiLine" class="mstxt"></zf:TextBox>
                    </div>
                </td>
            </tr>
           
            <tr>
                <td class="l">
                    <span class=" xh_">*</span>验证码：
                </td>
                <td class="r">
                    <div class="c">
                        <zf:TextBox runat="server" ID="tbVCode" class="sstxt"></zf:TextBox><img src="/ValidatePage.aspx"
                            style="cursor: pointer" class='vcodeimg' onclick="refreshValidateCodeImage(this);" />
                        <span class="zx_" id="tbVCodeTip"></span>
                    </div>
                </td>
            </tr>
            <tr class="b">
                <td colspan="2">
                    <zf:Button ID="btAdd" class="linkbtn addSubmit" OnClick="AddSubmit" runat="server"
                        Text=" 提 交 "></zf:Button>
                    <input type="button" class="linkbtn" value=" 取 消 " onclick="GoBack();" />
                </td>
            </tr>
            
        </table>
    </div>
</asp:Content>
